public class SolutionTest {
    static testMethod void testSolutionToIdea(){
        
        //First, prepare 20 solutions for the test data
        Solution[] SolutionsToCreate = new Solution[]{};
        for(Integer x=0; x<3;x++){
            Solution s = new Solution(SolutionName='test',SolutionNote='test',release__c='a0O80000001i1OwEAI',send_to_ideas__c=true);
            SolutionsToCreate.add(s);
        }
        Case[] CasesToCreate = new Case[]{};
        for(Integer x=0; x<3;x++){
            Case c = new Case(Subject='test',Description='test',Feature_Area__c='Alarms',Status = 'PCR Submitted',related_to__c='none',isVisibleInSelfService=false,current_release__c='a0O80000001i1OwEAI');
            CasesToCreate.add(c);
        }
                
        insert casesToCreate;
        insert solutionsToCreate;
        
        CaseSolution[] CaseSolutionsToCreate = new CaseSolution[]{};
        for(Integer x=0; x<3;x++){
            CaseSolution cs = new CaseSolution(CaseId=CasesToCreate[x].id,SolutionId=SolutionsToCreate[x].id);
            CaseSolutionsToCreate.add(cs);
        }
        insert caseSolutionsToCreate;
        
        for(Integer x=0; x<3;x++){
			SolutionsToCreate[x].isPublished = true;
			SolutionsToCreate[x].status = 'reviewed';
        }
		//Now update solutions causing triggers to fire. 
        Test.startTest();

        update SolutionsToCreate;
        
        Test.stopTest();    
    }
    static testMethod void testCaseReleaseToSolution(){
        
        //First, prepare 20 solutions for the test data
        Solution[] SolutionsToCreate = new Solution[]{};
        for(Integer x=0; x<3;x++){
            Solution s = new Solution(SolutionName='test',SolutionNote='test');
            SolutionsToCreate.add(s);
        }
        Case[] CasesToCreate = new Case[]{};
        for(Integer x=0; x<3;x++){
            Case c = new Case(Subject='test',Description='test',Feature_Area__c='Alarms',Status = 'Open',related_to__c='none',isVisibleInSelfService=false,current_release__c='a0O80000001i1OwEAI');
            CasesToCreate.add(c);
        }
                
        insert casesToCreate;
        insert solutionsToCreate;
        
        CaseSolution[] CaseSolutionsToCreate = new CaseSolution[]{};
        for(Integer x=0; x<3;x++)
        {
            CaseSolution cs = new CaseSolution(CaseId=CasesToCreate[x].id,SolutionId=SolutionsToCreate[x].id);
            CaseSolutionsToCreate.add(cs);
        }
        insert caseSolutionsToCreate;
        
        for(Integer x=0; x<3;x++)
        {
			SolutionsToCreate[x].status = 'reviewed';
        }
		//Now update solutions causing triggers to fire. 
        Test.startTest();

        update SolutionsToCreate;
        
        Test.stopTest();    
    }
    static testMethod void testSolutionMerge(){
        
        //First, prepare 20 solutions for the test data
        Solution[] SolutionsToCreate = new Solution[]{};
        for(Integer x=0; x<3;x++){
            Solution s = new Solution(SolutionName='test',SolutionNote='test',release__c='a0O80000001i1OwEAI');
            SolutionsToCreate.add(s);
        }
        Case[] CasesToCreate = new Case[]{};
        for(Integer x=0; x<3;x++){
            Case c = new Case(Subject='test',Description='test',Feature_Area__c='Alarms',Status = 'PCR Submitted',related_to__c='none',isVisibleInSelfService=false,current_release__c='a0O80000001i1OwEAI');
            CasesToCreate.add(c);
        }
                
        insert casesToCreate;
        insert solutionsToCreate;
        
        CaseSolution[] CaseSolutionsToCreate = new CaseSolution[]{};
        for(Integer x=0; x<3;x++){
            CaseSolution cs = new CaseSolution(CaseId=CasesToCreate[x].id,SolutionId=SolutionsToCreate[x].id);
            CaseSolutionsToCreate.add(cs);
        }
        insert caseSolutionsToCreate;
        
        for(Integer x=0; x<2;x++){
			SolutionsToCreate[x].merge_with_parent__c = true;
			SolutionsToCreate[x].solution_parent__c = SolutionsToCreate[2].Id;
        }
		//Now update solutions causing triggers to fire. 
        Test.startTest();

        update SolutionsToCreate;
        
        Test.stopTest();    
    }
}